<script type="text/javascript">
    $(function () {
        $("#xsd_ejdw").combobox({
            url: $.webPath() + "/organ/qyjg/nbjgList?qyjgId=" + $("#khId").val()
        });

        $("#xsd_search_grid").edatagrid({
            url: $.webPath() + "/xsgl/xsdgl/xsdSearchList?xsgsId=" + $("#xsgsId").val() + "&sbgsId=" + $("#sbgsId").val() + "&khId=" + $("#khId").val() + "&htbmStr=" + $("#htbm").val(),
            checkbox: true,
            fitColumns: false,
            singleSelect: false,
            pageNumber: 1,
            fit: true,
            pagination: true,
            checkOnSelect: false,
            selectOnCheck: false,
            rownumbers: true,
            frozenColumns: [
                [
                    {field: 'checked', checkbox: true},
                    {field: 'xhtbm', title: '来源系统合同号', width: 110, align: 'center'},
                    {field: 'htbm', title: '合同号', width: 110, align: 'center'},
                    {field: 'xsdh', title: '出库单号', width: 110, align: 'center'},
                    {field: 'fhsj', title: '出库日期', width: 70, align: 'center'},
                    {field: 'kh_qc', title: '客户名称', width: 150, align: 'center'}
//                    {field:'gc_mc', title:'工程名称', width:150, align:'center'}
                ]
            ],
            columns: [
                [
                    {field: 'cksl', title: '销售数量', width: 150, align: 'right'},
                    {field: 'xsje', title: '含税额(元)', align: 'right', formatter: function (value) {
                        var val = formatJe2(value);
                        return val;
                    }, width: 150},
                    {field: 'xsbhsje', title: '不含税额(元)', align: 'right', formatter: function (value) {
                        var val = formatJe2(value);
                        return val;
                    }, width: 150},
                    {field: 'xsgs_jc', title: '销售公司', width: 100, align: 'center'},
                    {field: 'sbgs_jc', title: '申报公司', width: 100, align: 'center'},
                    {field: 'sbbm_jc', title: '申报部门', hidden: true, align: 'center'}
//                    {field:'sbr_xm', title:'申报人', width:100, align:'center'}
                ]
            ],
            onLoadSuccess: function () {
                $(".datagrid-htable .datagrid-cell").css('text-align', 'center');
            }
        });

        $("#btn_xsd_search_init").click(function () {
            xsd_search_init();
        });
    })

    function xsd_search_init() {
        var fhsjStart = $('#xsd_fhsj_start').datebox('getValue');
        var fhsjEnd = $('#xsd_fhsj_end').datebox('getValue');
        var xhtbm = $('#xsxt_htbm').val();
        var xsdh = $('#xsdh').val();
        /* var erdwMc = $('#xsd_ejdw').combobox('getText');*/
        $('#xsd_search_grid').datagrid('load',
                {
                    xsdh: $('#xsd_xsdh').val(),
                    fhsjStart: fhsjStart,
                    fhsjEnd: fhsjEnd,
                    xhtbm: xhtbm,
                    xsdh: xsdh
                    /*erdwMc:erdwMc*/
                }
        );
    }

</script>
<input type="hidden" id="xsgsId" value="${(xsgsId)!}"/>
<input type="hidden" id="sbgsId" value="${(sbgsId)!}"/>
<input type="hidden" id="khId" value="${(khId)!}"/>
<input type="hidden" id="htbm" value="${(htbm)!}"/>
<div id="layout_xsd_search" class="easyui-layout" data-options="fit:true">
    <div data-options="region:'center'">
        <div id="toolbar_xsd_search">
            <div style="height: 8px;">

            </div>
            <div class="textcon">
                <table class="tb">
                    <tr>
                        <th>来源系统合同号：</th>
                        <td><input id="xsxt_htbm" name="xhtbm" type="text" class="input-text"></td>
                        <th>出库单号：</th>
                        <td><input id="xsdh" name="xsdh" type="text" class="input-text"></td>
                    <#--<th>二级单位：</th>
                    <td>
                        <input id="xsd_ejdw" type="text" class="easyui-combobox input-text"
                               data-options="valueField:'id',textField:'jc',panelHeight:'200'"/>
                    </td>-->
                    </tr>
                    <tr>
                        <th>出库日期：</th>
                        <td><input id="xsd_fhsj_start" type="text" class="easyui-datebox input-text"/></td>
                        <td align="center">至</td>
                        <td><input id="xsd_fhsj_end" type="text" class="easyui-datebox input-text"/></td>
                        <td style=" padding-left:5px;"><input id="btn_xsd_search_init" type="button" value=""
                                                              class="submit"/></td>
                    </tr>
                </table>
            </div>
        </div>
        <table id="xsd_search_grid"></table>
    </div>
</div>